package com.train.daily.api;

import com.train.common.constants.ApiConstants;
import com.train.common.resp.CommonResp;
import com.train.daily.api.fallback.DailyTrainSkTokenApiFallback;
import com.train.daily.dto.token.DailyTrainSkTokenValidDTO;
import com.train.daily.dto.token.DailyTrainTokenQueryLeftDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(
        contextId = "dailyTrainSkTokenApi",
        name = ApiConstants.DAILY_TRAIN_NAME,
        path = ApiConstants.DAILY_TRAIN_PREFIX,
        fallback = DailyTrainSkTokenApiFallback.class)
public interface DailyTrainSkTokenApi {

    String PREFIX = "/token";

    @PostMapping(PREFIX + "/decrement")
    CommonResp decrementSkToken(@RequestBody DailyTrainSkTokenValidDTO dto);

    @PostMapping(PREFIX + "/left")
    CommonResp getSkToken(@RequestBody DailyTrainTokenQueryLeftDTO dto);
}
